package edu.tum.in.campar.twodui.studentcanteen;

import edu.tum.in.campar.twodui.studentcanteen.model.DailyMenu;
import edu.tum.in.campar.twodui.studentcanteen.model.DataProvider;
import android.app.Activity;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class SLDateOverviewActivity extends ListActivity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
        ListView list = getListView();
        list.setAdapter(new ArrayAdapter<DailyMenu>(this, android.R.layout.simple_list_item_1, DataProvider.get().getData()));
	}
	
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		super.onListItemClick(l, v, position, id);
		
		Intent i = new Intent(this, SLMealDetailActivity.class);
		i.putExtra("day", position);
		startActivity(i);
	}
}
